home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Libris Britannia 4
/
science library(b).zip
/
science library(b)
/
HAM_RAD
/
3345.ZIP
/
NKFDRV.DOC
< prev
next >
Wrap
Text File
|
1988-06-19
|
3KB
|
71 lines
Documentation for NKFSA v0.96 User-Written Drivers...
NKFSA can be interfaced to any A/D hardware via a User-Written Driver Program.
This document describes the interface between NKFSA and the driver, and
describes the example driver that comes with NKFSA.
NKFSA calls the driver via a software interrupt. You get to choose which
software interrupt NKFSA will use for this purpose. The default is int 0F1H.
It is assumed that the driver is written in the form of a TSR. TSR is DOS
nomenclature for a program that uses the DOS Terminate-and-Stay-Resident
function.
Once your driver is written and working, you simply execute it, which will
cause it to load, initialize itself, then, of course, terminate-and-stay-
resident. After that, anytime NKFSA is run, it can use the driver and access
your A/D.
An example driver SAMTSR.COM is provided. Because it is only an example, it
does not require any A/D converter hardware. When called by NKFSA, it simply
returns a fixed waveform it has stored inside. To try SAMTSR...
> SAMTSR <---causes sample user-written driver to load
> NKFSA -su <---fires up NKFSA specifying the user-written driver
When NKFSA issues software interrupt 0F1H to call the driver, the registers
have the following meanings...
AX = -1 means that this call is to set the sample rate
ES:BX = address of doubleword containing the sample rate in Hz.
AX >0 means that this call is to fetch a buffer of samples
AX contains NUMSAM, the number of samples desired
ES:BX = address of sample buffer. Driver must transfer NUMSAM
samples into the buffer. Each sample is a 16-bit number
in ordinary 2's-complement form, in the range [-8192,+8191].
To make your own driver, make a copy of SAMTSR.ASM, and add the code required
to talk to your A/D converter hardware. (Give your file a new name!)
The comments in SAMTSR should be adequate to guide you, even if you have never
written a TSR before.
The sample TSR provided uses interrupt 0F1H. If this interrupt is already
used by some other software you use, you may change the interrupt by editing
the value of the user_supplied_driver_interrupt_number in the NKFSA.INI file,
and altering the corresponding parameter in your driver TSR. If you decide to
use a different interrupt, it is strongly suggested that you choose one of the
interrupts that Microsoft & IBM have "reserved for user program interrupts".
These are 60H thru 66H and 0F1H thru 0FFH.
TSRs can be a little tricky to debug, so it is suggested that you debug the
code that talks to your A/D hardware in a normal (not TSR) program before you
integrate that code into SAMTSR.
To generate the executable form of your TSR...
Use MASM to make a .OBJ file
Use LINK to make a .EXE file (it will complain that there's no stack
segment, but that's normal when generating a .COM file)
Use EXE2BIN to make the .COM file
Alternatively, if you don't want to write in assembler, i'm told some compilers
now are able to generate TSRs. If you have one, great, but don't ask me
questions about that. I've never tried it.
73,
Franklin Antonio
N6NKF
06/17/88